package br.com.fiap.atividade6.factory;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JComponent;

public class CriaBotao implements CriaComponenteInterface {

    public JComponent criaComponente() {
        final JButton button = new JButton("Clicar!");
        button.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				button.setText("Sucesso!");
			}
        });
        return button;            
    }

    public String getTitulo() {
        return "Exemplo 1: A JButton";
    }
}		
